package cc.yihy.spider.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "POST",
        uniqueConstraints = {
                @UniqueConstraint(name = "IDX_ID", columnNames = "ID")
        })
@Data
public class Post {

    @Id
    @Column(name = "ID", nullable = false, unique = true)
    private Integer id;

    @Column(name = "author", length = 50)
    private String author;

    @Column(name = "TITLE", length = 100)
    private String title;

    @Column(name = "tag", length = 100)
    private String tag;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "creat_date")
    private Date publishTime;

    @Lob
    @Column(name = "html")
    private String content;
    @Lob
    @Column(name = "markdown")
    private String markdown;

    @Lob
    @Column(name = "info")
    private String jsonInfo;

    @Column(name = "URL")
    private String url;
}
